<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>MVC Pattern</title>
	<script src="./js/libraries/jquery/jquery.min.js" type="text/javascript" ></script>
	<script src="./js/libraries/jquery/jquery.easing.1.3.js" type="text/javascript" ></script>
	<script src="./js/libraries/jquery/jquery.easing.extend.js" type="text/javascript" ></script>
	<script src="./js/libraries/jquery/jquery.tmpl.min.js" type="text/javascript" ></script>
	
	<script src="./js/core/class.js"></script>
	<script src="./js/core/define.js"></script>
	
	<link rel="stylesheet" type="text/css" href="./css/base.css" />
</head>
<body>
	
	<h2>Javascript MVC Pattern</h2>
	<div id="stage"></div>
	<div id="manual">
	<pre>
		게임설명 : 자동차를 움직여 바위가 나타나면 점프하여 피하는 게임
		
		Start & Play : 방향키 오른쪽
		Stop : 방향키 왼쪽
		Jump : 방향키 위쪽 또는 스페이스바
		Retry : ready 버튼을 마우스 클릭
	</pre> 
	</div>
	<input type="button" id="ready_button" value="ready" />
	<input type="button" id="download_button" value="download" />

<script type="text/javascript">
<!--//
(function(window, undefined) {

$readyButton = $("#ready_button");
$downloadButton = $("#download_button");

$readyButton.click( function() {
	gameController.ready();
});

$downloadButton.click( function() {
	location.href = "mvc.tar";
});

// Import
Class.import( "mvc" );
Class.import( "prototype.array" );
Class.import( "helper.eventdispatcher" );
Class.import( "helper.timer" );

// Require
Class.define( [
		"car.template.gamestatusview",
		"car.model.gameinfo",
		"car.view.stage",
		"car.view.background",
		"car.view.rock",
		"car.view.car",
		"car.view.gamestatusview",
		"car.controller.gamecontroller"
	], function() {
	 
		var GameController = Class.Controller.GameController;
	
		var gameController = new GameController();
		gameController.setStage( $("#stage") );
		gameController.makeResource();
		gameController.ready();
		
		window.gameController =gameController;
});

})(window);

//-->
</script>
</body>
</html>
